package com.zr.model;
// Generated 2016-6-19 19:35:13 by Hibernate Tools 3.2.2.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TOrder generated by hbm2java
 */
@Entity
@Table(name = "t_order", catalog = "ld_sys")
public class TOrder implements java.io.Serializable {

	private Integer oid;
	private TStatus TStatus;
	private TPay TPay;
	private TGood TGood;
	private TIncome TIncome;
	private String sender;
	private String address1;
	private Integer phone1;
	private String sendtime1;
	private String addressee;
	private String address2;
	private Integer phone2;
	private String addresseetime;
	private Set<TAuditing> TAuditings = new HashSet<TAuditing>();
	private Set<TRecord> TRecords = new HashSet<TRecord>();
	private Set<TStatus> TStatuses = new HashSet<TStatus>();

	public TOrder() {
	}

	public TOrder(TStatus TStatus, TPay TPay, TGood TGood, TIncome TIncome, String sender, String address1,
			Integer phone1, String sendtime1, String addressee, String address2, Integer phone2, String addresseetime,
			Set<TAuditing> TAuditings, Set<TRecord> TRecords, Set<TStatus> TStatuses) {
		this.TStatus = TStatus;
		this.TPay = TPay;
		this.TGood = TGood;
		this.TIncome = TIncome;
		this.sender = sender;
		this.address1 = address1;
		this.phone1 = phone1;
		this.sendtime1 = sendtime1;
		this.addressee = addressee;
		this.address2 = address2;
		this.phone2 = phone2;
		this.addresseetime = addresseetime;
		this.TAuditings = TAuditings;
		this.TRecords = TRecords;
		this.TStatuses = TStatuses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "oid", unique = true, nullable = false)
	public Integer getOid() {
		return this.oid;
	}

	public void setOid(Integer oid) {
		this.oid = oid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sid")
	public TStatus getTStatus() {
		return this.TStatus;
	}

	public void setTStatus(TStatus TStatus) {
		this.TStatus = TStatus;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pid")
	public TPay getTPay() {
		return this.TPay;
	}

	public void setTPay(TPay TPay) {
		this.TPay = TPay;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "gid")
	public TGood getTGood() {
		return this.TGood;
	}

	public void setTGood(TGood TGood) {
		this.TGood = TGood;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "iid")
	public TIncome getTIncome() {
		return this.TIncome;
	}

	public void setTIncome(TIncome TIncome) {
		this.TIncome = TIncome;
	}

	@Column(name = "sender")
	public String getSender() {
		return this.sender;
	}

	public void setSender(String sender) {
		this.sender = sender;
	}

	@Column(name = "address1")
	public String getAddress1() {
		return this.address1;
	}

	public void setAddress1(String address1) {
		this.address1 = address1;
	}

	@Column(name = "phone1")
	public Integer getPhone1() {
		return this.phone1;
	}

	public void setPhone1(Integer phone1) {
		this.phone1 = phone1;
	}

	@Column(name = "sendtime1")
	public String getSendtime1() {
		return this.sendtime1;
	}

	public void setSendtime1(String sendtime1) {
		this.sendtime1 = sendtime1;
	}

	@Column(name = "addressee")
	public String getAddressee() {
		return this.addressee;
	}

	public void setAddressee(String addressee) {
		this.addressee = addressee;
	}

	@Column(name = "address2")
	public String getAddress2() {
		return this.address2;
	}

	public void setAddress2(String address2) {
		this.address2 = address2;
	}

	@Column(name = "phone2")
	public Integer getPhone2() {
		return this.phone2;
	}

	public void setPhone2(Integer phone2) {
		this.phone2 = phone2;
	}

	@Column(name = "addresseetime")
	public String getAddresseetime() {
		return this.addresseetime;
	}

	public void setAddresseetime(String addresseetime) {
		this.addresseetime = addresseetime;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinTable(name = "o_a", catalog = "ld_sys", joinColumns = {
			@JoinColumn(name = "oid", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "aid", nullable = false, updatable = false) })
	public Set<TAuditing> getTAuditings() {
		return this.TAuditings;
	}

	public void setTAuditings(Set<TAuditing> TAuditings) {
		this.TAuditings = TAuditings;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TOrder")
	public Set<TRecord> getTRecords() {
		return this.TRecords;
	}

	public void setTRecords(Set<TRecord> TRecords) {
		this.TRecords = TRecords;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinTable(name = "o_s", catalog = "ld_sys", joinColumns = {
			@JoinColumn(name = "oid", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "sid", nullable = false, updatable = false) })
	public Set<TStatus> getTStatuses() {
		return this.TStatuses;
	}

	public void setTStatuses(Set<TStatus> TStatuses) {
		this.TStatuses = TStatuses;
	}

}
